import { Library } from "@/api/service/library/types";
import { ENUM_DATA_SCOPE } from "@/enum/system.enum";
import { IQuery, TableConfig } from "@/interface/IAxios";
import { SelectOption } from "@arco-design/web-vue";

export const libraryKeys = ref();

export const libraryTable = ref<TableConfig<Library>>({
  data: [],
  loading: false,
  rowKey: "",
  keys: []
});

const query: IQuery = {
  pageNum: 1,
  pageSize: 20,
  total: 0,
  sizeId: "",
  scope: ENUM_DATA_SCOPE.THIS_SHOP_AND_SHARED,
  name: "",
  type: "",
  orderByColumn: "res_id",
  isAsc: "desc"
};
export const libraryQuery = ref<IQuery>({
  ...query
});
export const librarySizeData = ref<SelectOption[]>([]);
export const resetQuery = () => {
  libraryQuery.value = {
    ...query
  };
};
